load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "physical",
    srcs = [
        "alter_replication_job.go",
        "external_connection.go",
        "ingest_span_configs.go",
        "merged_subscription.go",
        "metrics.go",
        "node_lag_detector.go",
        "replication_execution_details.go",
        "stream_ingest_manager.go",
        "stream_ingestion_dist.go",
        "stream_ingestion_frontier_processor.go",
        "stream_ingestion_job.go",
        "stream_ingestion_planning.go",
        "stream_ingestion_processor.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/crosscluster/physical",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/ccl/backupccl",
        "//pkg/ccl/crosscluster",
        "//pkg/ccl/crosscluster/producer",
        "//pkg/ccl/crosscluster/replicationutils",
        "//pkg/ccl/crosscluster/streamclient",
        "//pkg/ccl/revertccl",
        "//pkg/ccl/utilccl",
        "//pkg/cloud/externalconn",
        "//pkg/cloud/externalconn/connectionpb",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/jobs/jobsprofiler",
        "//pkg/jobs/jobsprotectedts",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/bulk",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/protectedts",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/multitenant/mtinfopb",
        "//pkg/repstream",
        "//pkg/repstream/streampb",
        "//pkg/roachpb",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/sql",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/clusterunique",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/exprutil",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/physicalplan",
        "//pkg/sql/privilege",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowexec",
        "//pkg/sql/sem/asof",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlliveness",
        "//pkg/sql/syntheticprivilege",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/util/bulk",
        "//pkg/util/ctxgroup",
        "//pkg/util/hlc",
        "//pkg/util/humanizeutil",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/protoutil",
        "//pkg/util/retry",
        "//pkg/util/span",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "physical_test",
    size = "large",
    srcs = [
        "alter_replication_job_test.go",
        "datadriven_test.go",
        "ingest_span_configs_test.go",
        "main_test.go",
        "merged_subscription_test.go",
        "node_lag_detector_test.go",
        "rangekey_batcher_test.go",
        "replication_execution_details_test.go",
        "replication_random_client_test.go",
        "replication_stream_e2e_test.go",
        "stream_ingestion_dist_test.go",
        "stream_ingestion_frontier_processor_test.go",
        "stream_ingestion_job_test.go",
        "stream_ingestion_manager_test.go",
        "stream_ingestion_processor_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":physical"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "heavy"},
        "//conditions:default": {"test.Pool": "large"},
    }),
    shard_count = 16,
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/ccl/backupccl",
        "//pkg/ccl/changefeedccl",
        "//pkg/ccl/changefeedccl/cdctest",
        "//pkg/ccl/crosscluster",
        "//pkg/ccl/crosscluster/producer",
        "//pkg/ccl/crosscluster/replicationtestutils",
        "//pkg/ccl/crosscluster/replicationutils",
        "//pkg/ccl/crosscluster/streamclient",
        "//pkg/ccl/crosscluster/streamclient/randclient",
        "//pkg/ccl/kvccl/kvtenantccl",
        "//pkg/ccl/storageccl",
        "//pkg/cloud/impl:cloudimpl",
        "//pkg/cloud/nodelocal",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv/kvclient/rangefeed/rangefeedcache",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/protectedts",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/repstream/streampb",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/server/serverpb",
        "//pkg/server/telemetry",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/spanconfig/spanconfigptsreader",
        "//pkg/sql",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/isql",
        "//pkg/sql/physicalplan",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlliveness",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/distsqlutils",
        "//pkg/testutils/jobutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/storageutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/ctxgroup",
        "//pkg/util/duration",
        "//pkg/util/hlc",
        "//pkg/util/httputil",
        "//pkg/util/leaktest",
        "//pkg/util/limit",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/rangedesc",
        "//pkg/util/span",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
